﻿@{
    Layout = null;
    var tid = (Session["user"] as WebAppModel.UserScanQRInfoModel).TId;
}
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">

<title>奖品领取成功</title>
<script src="~/Content/Script/jquery.min.js"></script>
<link href="~/Content/css/animate.min.css" rel="stylesheet" />
<script src="~/Scripts/base64.js"></script>
<style>
    .isNoPublic {
        height: 1.4rem;
        width: 11.25rem;
        margin: 0 auto;
        font-size: .7rem;
        color: #fff;
        text-align: center;
        line-height: 1.4rem;
        position: absolute;
        left: 0;
        top: 0;
        z-index: 9999;
        background: url(https://shnbbucket.oss-cn-beijing.aliyuncs.com/20180315233216.png) no-repeat;
        background-size: 100%;
    }
    * {
        padding: 0;
        margin: 0;
        cursor: pointer;
    }

    #LoadingBar {
        position: absolute;
        background-color: rgba(0,0,0,.85);
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 999;
    }

    .bg-con {
        width: 100%;
        height: 100%;
        position: absolute;
        left: 0;
        top: 0;
        background-color: rgba(0,0,0,.85);
        display: none;
        z-index: 100;
    }

        .bg-con .closeBgCon {
            position: absolute;
            width: 100%;
            height: 50px;
            bottom: 3%;
            display: flex;
            justify-content: center;
            align-items: center;
        }

            .bg-con .closeBgCon img {
                width: 50px;
                height: 100%;
            }


    .result {
        width: 100%;
        height: 100%;
        position: absolute;
       
    }

        .result > img {
            display: block;
            margin: 10px auto;
            width: 105px;
            height: 105px;
        }

        .result > p:nth-child(2) {
            font-size: 28px;
            color: #FDBE9B;
            text-align: center;
        }

        .result > p:nth-child(3) {
            font-size: 18px;
            color: #FDBE9B;
            text-align: center;
        }


        .result > .Bottom {
            position: absolute;
            bottom: 20px;
            left: 0;
            right: 0;
            margin: 0 auto;
            text-align: center;
        }

            .result > .Bottom > a.aBtn {
                text-decoration: none;
                display: inline-block;
                background-color: #FFCC00;
                height: 25px;
                color: #763401;
                line-height: 25px;
                border-radius: 5px;
                padding: 5px 15px;
            }

        .result .bg-con > div.info {
            position: absolute;
            width: 100%;
            height: 60%;
            top: 15%;
        }

        .result .bg-con div.info > h2 {
            color: #F3C99B;
            height: 20%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

    ul.my-award {
        width: 92%;
        margin: 0 auto;
        height: 78%;
        overflow: auto;
        border-radius: 4px;
    }

        ul.my-award a {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid #FDBE9B;
            padding: 10px;
            text-decoration: none;
        }

    .btn-default {
        display: inline-block;
        padding: 6px 12px;
        margin-bottom: 0;
        font-size: 14px;
        font-weight: 400;
        line-height: 1.42857143;
        text-align: center;
        white-space: nowrap;
        vertical-align: middle;
        -ms-touch-action: manipulation;
        touch-action: manipulation;
        cursor: pointer;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        background-image: none;
        border: 1px solid transparent;
        border-radius: 4px;
    }

    ul.my-award a > div:nth-child(1) > div:nth-child(1) {
        color: #FDBE9B;
    }

    ul.my-award a > div:nth-child(1) > div:nth-child(2) {
        color: #FDBE9B;
    }

    .result .bg-con div.info > .details-info {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 10px;
        padding: 0 5%;
    }

        .result .bg-con div.info > .details-info > div:nth-child(1) > p:nth-child(1) {
            color: #F3C99B;
            margin-bottom: 7px;
        }

        .result .bg-con div.info > .details-info > div:nth-child(1) > p:nth-child(2) {
            font-size: 12px;
            color: #F3C99B;
        }

        .result .bg-con div.info > .details-info > div:nth-child(2) {
            border-radius: 5px;
            text-align: center;
            padding: 7px 25px;
            color: #F3C99B;
        }

    .pageTitle {
        display: none;
    }
</style>



<style>
    #QRcode {
        width: 100%;
        border-radius: 3px;
        height: 100%;
        top: 8%;
        position: absolute;
    }

    .result > p:nth-child(3), .result > p:nth-child(5) {
        font-size: 18px;
        color: #FDBE9B;
        text-align: center;
    }

    .result > .longTab {
        height: 44%;
        width: 70%;
        margin: 10px auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
    }

        .result > .longTab > div.resizable.draggable {
            height: 65%;
            width: 65%;
        }

            .result > .longTab > div.resizable.draggable > img {
                height: 100%;
                width: 100%;
                border-radius: 4px;
            }

        .result > .longTab > img:nth-child(2) {
            height: 30%;
            width: 30%;
        }

</style>


<body>
    <div class="isNoPublic">
        活动尚未发布，当前仅供预览！
    </div>
    <div id="LoadingBar">
        <img src="~/Content/Images/redpack/loading.gif" />
    </div>
    @*<div class="result">
            <img src="http://avrilbucket.oss-cn-beijing.aliyuncs.com/d125f2fa-6042-41cc-a116-161780c98783redPacket-04B.png" alt="">
            <p>红包领取成功</p>
            <p>已存入微信零钱</p>
            <div class="longTab">
                <img src="http://avrilbucket.oss-cn-beijing.aliyuncs.com/21b38ba7-55b5-4330-8fa0-5617d075d1991512525716.png" alt="Alternate Text" />
                <img src="~/Content/Images/redpack/zhiwen.svg" />
                <p>长按关注公众号</p>
            </div>

            <div class="Bottom">
                <a href="" class="aBtn">分享活动</a>
                <a class="aBtn" style="margin-left: 10px" onclick="showResult(this)">中奖纪录</a>
            </div>
            <div class="bg-con">
                <div class="info animated bounceIn">
                    <h2>中奖纪录</h2>
                    <ul class="my-award"></ul>
                </div>
                <div class="closeBgCon">
                    <img class="closeBg" src="http://avrilbucket.oss-cn-beijing.aliyuncs.com/0076e1b0-c3c7-45c8-bd6a-6f708b4b06d8redPacket-051.png" alt="Alternate Text" />
                </div>

            </div>
        </div>*@
</body>


<script>
    var aid = "@ViewBag.Aid";//模板Id
    $.ajax({
        url: "GetInFormHtml",
        data: { aId: aid },
        type: "post",
        success: function (res) {
            $('body').append(decode(res));
            getInfo();
        }
    });



   
    function showResult(ele) {
        $(ele).parent().next('.bg-con').css('display', 'block');
        $(ele).parent().next('.bg-con').find('.closeBgCon').click(function () {
            $(this).parent().hide();
        });
    }
    function DateFormat(val) {
        var date = new Date(parseInt(val.replace("/Date(", "").replace(")/", ""), 10));
        //月份为0-11，所以+1，月份小于10时补个0
        var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
        var currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
        var currentHour = date.getHours();
        var currentMin = date.getMinutes();
        var currentSecond = date.getSeconds();
        var dd = date.getFullYear() + "-" + month + "-" + currentDate + ' ' + currentHour + '：' + currentMin + '：' + currentSecond;
        return dd;
    }
    //获取当前时间，格式YYYY-MM-DD
    function getNowFormatDate() {
        var date = new Date();
        var seperator1 = "-";
        var year = date.getFullYear();
        var month = date.getMonth() + 1;
        var strDate = date.getDate();
        var hour = date.getHours();
        var min = date.getMinutes();
        var min = date.getSeconds();
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
            strDate = "0" + strDate;
        }
        var currentdate = year + seperator1 + month + seperator1 + strDate + ' ' + hour + ':' + min + ':' + min;
        return currentdate;
    }
 

    //获取url中的参数
    function getUrlParam(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
        var r = window.location.search.substr(1).match(reg); //匹配目标参数
        if (r != null) return unescape(r[2]); return null; //返回参数值
    }

    //获取我的中奖记录数据
    function getInfo() {
        var Denomination = getUrlParam("denomination");
        $('.my-award').html("");

        var tid = "@tid";
        var e = '<a href="PrizeDetailsShow?tId=' + tid + '">\n' +
              ' <div>\n' +
              '<div>获得' + parseFloat(Denomination).toFixed(2) + '元微信红包</div>\n' +
              ' <div>' + getNowFormatDate() + '</div>\n' +
              ' </div>\n' +
              ' <button class="btn btn-default">已领取</button>\n' +
              ' </a>';
                    $('.my-award').append(e);
    
    }


    function closePage() {
        WeixinJSBridge.call('closeWindow');
    }
   

    function initPage() {
        var objLoading = document.getElementById("LoadingBar");
        if (objLoading != null) {
            objLoading.style.display = "none";  
        }
    }
    window.onload = initPage();

</script>


